package com.kgc.storeprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.QualityDetail;
import com.kgc.store.remote.QualityDetailRemote;
import com.kgc.storeprovider.service.QualityDetailService;
import com.kgc.storeprovider.service.QualityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class QualityDetailController implements QualityDetailRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private QualityDetailService qualityDetailService;

    @Override
    public ResponseMsg getQualityDetailList(String qualityCode) {
        logger.info("QualityDetailController getQualityDetailList qualityCode:"+qualityCode);
        ResponseMsg msg = qualityDetailService.getQualityDetailList(qualityCode);
        logger.debug("QualityDetailController getQualityDetailList msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delQualityDetailByQualityCode(String qualityCode) {
        logger.info("QualityDetailController getQualityDetailList qualityCode:"+qualityCode);
        ResponseMsg msg = qualityDetailService.delQualityDetailByQualityCode(qualityCode);
        logger.debug("QualityDetailController getQualityDetailList msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg addQualityDetail(QualityDetail qualityDetail) {
        logger.info("QualityDetailController addQualityDetail qualityDetail:"+qualityDetail);
        ResponseMsg msg = qualityDetailService.addQualityDetail(qualityDetail);
        logger.debug("QualityDetailController addQualityDetail msg:"+msg);
        return msg;
    }
}
